/*
 * XDVFloatUtility.h
 *
 *  Created on: 04/06/2013
 *      Author: MakotoMatayoshi
 */

#ifndef XDVFloatUtility_H_
#define XDVFloatUtility_H_

#include <math.h>
#include <float.h>
#include <stddef.h>

class XDVFloatUtility {
public:
	XDVFloatUtility();
	virtual ~XDVFloatUtility();

	static float Cot( float z );

	static void SinCos( float a, float* sina, float* cosa );

	static float Step( float edge, float v );

	static float SmoothStep( float edge0, float edge1, float v );

	static float Length( float v );

	static float Min( float a, float b );

	static float Max( float a, float b );

	/*Not sure if it's working
	static void GetGaussianBlurKernel1D( int s, float o, float* kernel );

	static void GetGaussianBlurKernel2D( int s, float o, float* kernel );
	*/

	static float DegreeToRadian( float deg );

	static float RadianToDegree( float rad );

	static float Mix( float x, float y, float a );

	static float Distance( float p0, float p1 );

	static float Clamp( float v, float min, float max );

	static float Saturate( float v );

	static int Min( int a, int b );

	static int Max( int a, int b );

	static int Clamp( int v, int vmin, int vmax );

	static size_t Min( size_t a, size_t b );

	static size_t Max( size_t a, size_t b );

	static size_t Clamp( size_t v, size_t vmin, size_t vmax );
};

#endif /* XDVFloatUtility_H_ */
